from langchain_text_splitters import RecursiveCharacterTextSplitter

text = "卡拉斯对方理解啊拉屎的老方看就是打了几分离开设计方案斯库拉多夫降落伞打开肌肤设计老方看见阿水淀粉"
text_splitter = RecursiveCharacterTextSplitter(
    chunk_size=30,
    chunk_overlap=10,
    separators=[""," "], #无有效分割时按字符分割
    length_function=len
)

chunks = text_splitter.split_text(text)
for i,chunk in enumerate(chunks):
    print(f"块{i+1}(长度{len(chunk)})):{chunk}")